// src/main.js (或 App.vue 的 setup/onMounted)
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import { useAuthStore } from './stores/auth' // <-- 导入 Store

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)
app.use(router)

// **【修复点 3】: 在 Pinia 和 App.use(router) 之后调用 initialize**
// 确保 Store 实例被创建后立即初始化
const authStore = useAuthStore()
authStore.initialize()

app.mount('#app')
